<template>
  <div class="user-info">
    <h2>用户信息</h2>
    <p>用户名：{{ username }}</p>
    <p>角色：{{ role }}</p>
  </div>
</template>

<script>
export default {
  computed: {
    username() {
      return localStorage.getItem('username');
    },
    role() {
      return localStorage.getItem('role');
    }
  }
};
</script>